﻿using System;
using System.Runtime.Serialization;

namespace NeroConnect.Network
{
	/// <summary>
	/// Web exception to be expected in some method calls of the NCNcetwork interface implementations
	/// </summary>
	[Serializable]
	public abstract class WebException : InvalidOperationException
	{
		/// <summary>
		/// constructor
		/// </summary>
		/// <param name="message">message of the exception</param>
		/// <param name="innerException">inner exception</param>
		protected WebException(string message, Exception innerException) : base(message, innerException) {}

		/// <summary>Initializes a new instance of the System.InvalidOperationException class with serialized data.</summary>
		/// <param name="info">The object that holds the serialized object data.</param>
		/// <param name="context">The contextual information about the source or destination.</param>
		protected WebException(SerializationInfo info, StreamingContext context) : base(info, context) { }

		/// <summary>
		/// Gets the server response. This could be empty if no response has been received yet
		/// </summary>
		public abstract IResponse Response { get; }
		/// <summary>
		/// More detailed status of the exception
		/// </summary>
		public abstract System.Net.WebExceptionStatus Status { get; }
	}
}
